From: Florian Müllner Date: Thu, 14 Apr 2016 15:18:42 +0000 (+0200) Subject: st: Do not try to unref NULL CoglObjects X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~882 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=59c2ace98c99db57d085c2fe61f85d2dceff95e4;p=gnome-shell.git st: Do not try to unref NULL CoglObjects https://bugzilla.gnome.org/show_bug.cgi?id=765061 --- diff --git a/src/st/st-private.c b/src/st/st-private.c index d40eceb86..e5a27019b 100644 --- a/src/st/st-private.c +++ b/src/st/st-private.c @@ -395,7 +395,10 @@ _st_create_shadow_pipeline (StShadow *shadow_spec, pipeline = cogl_pipeline_copy (shadow_pipeline_template); cogl_pipeline_set_layer_texture (pipeline, 0, texture); - cogl_object_unref (texture); + + if (texture) + cogl_object_unref (texture); + return pipeline; } diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index 88c6bf3ec..cec97d538 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -640,8 +640,12 @@ st_texture_cache_reset_texture (StTextureCachePropertyBind *bind, cairo_image_surface_get_stride (surface), cairo_image_surface_get_data (surface), NULL)); - clutter_texture_set_cogl_texture (bind->texture, texdata); - cogl_object_unref (texdata); + + if (texdata) + { + clutter_texture_set_cogl_texture (bind->texture, texdata); + cogl_object_unref (texdata); + } clutter_actor_set_opacity (CLUTTER_ACTOR (bind->texture), 255); }